#include"comm.h"
#define _SIZE 1024
int main()
{

    int fd = open(FIFO_FILE, O_WRONLY);
    if (fd < 0)
    {
        perror("open");
        exit(2);
    }
    while(1)
    {
        char str[_SIZE] = {"\0"};
        read(0, str, sizeof(str));
        str[sizeof(str)] = '\0';
        write(fd, str, sizeof(str)); 
        sleep(1);
    }
    close(fd); 
    int r2 = unlink(FIFO_FILE);
    if (r2 < 0)
    {
        perror("unlink");
        exit(3);
    }
    return 0;
}